﻿using System;
using Framework;

namespace Enterprise.Admin.Handle
{
    public partial class GetAdminUserDetailJson : AdminBasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            var id = Fq("Id").SafeToInt();
            var adminService = new AdminService();
            var record = adminService.GetById(id);
            object result = new
                                {
                                    total = 3,
                                    rows = new[]
                                            {
                                                new
                                                    {
                                                        name = "ID",
                                                        value = record["CoAdminId"],
                                                        editor = "text",
                                                        fielid = "CoAdminId"
                                                    },
                                                new
                                                    {
                                                        name = "用户名",
                                                        value = record["CoUserName"],
                                                        editor = "text",
                                                        fielid = "CoUserName"
                                                    },
                                                new
                                                    {
                                                        name = "密码",
                                                        value = record["CoPassword"],
                                                        editor = "text",
                                                        fielid = "CoPassword"
                                                    }
                                            }
                                };
            Json(result);
        }
    }
}